var hosts_array = new Array(6);

function hostGet(auth, url) {
	var tmp = '';
    var json_data = JSON.stringify({
        "jsonrpc": "2.0",
        "method": "host.get",
        "params": {
            "output": "extend",
            "monitored_hosts": "True"
        },
        "auth": auth,
        "id": 1
    });
    $.ajax({
        url: url,
        method: 'post',
        dataType: 'json',
		async: false,
        headers: { "Content-Type": "application/json" },
        data: json_data,
        success: function(data) {
            // console.log(data);
            // console.log(data.result.length);
			tmp = data.result;
			// console.log(tmp);
            // alert(data.result.length)
        }
    });
	return tmp;
}

function hostGetAll(){
	for (i in auth_array){
		var tmp = hostGet(auth_array[i], url_array[i]);
		hosts_array[i] = tmp;
		// console.log(hosts_array[i].length);
		// for(j in hosts_array[i]){
		// 	console.log(hosts_array[i][j].hostid);
		// }
	}
}

hostGetAll();